import java.util.ArrayList;
	import java.util.List;
public class Day18Test1 {
	public static void main(String[] args) {
	List<String> list = new ArrayList<>();
			
			list.add("a");
			list.add("a");
			list.add("a");
			list.add("b");
			list.add("b");
			list.add("c");
			list.add("d");
			list.add("d");
			list.add("d");
			list.add("d");
			list.add("d");
			
			System.out.println(frequency(list, "a"));	
			System.out.println(frequency(list, "b"));	
			System.out.println(frequency(list, "c"));	
			System.out.println(frequency(list, "d"));
			}	
			private static int frequency(List<String> list, String string) {
				int count = 0;
				for(String s : list){
					if(string.equals(s)){
						count++;
					}
				}
				return count;
			}

	}


